package gui.Principal;

import java.awt.SystemColor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.JList;
import javax.swing.JScrollBar;
import javax.swing.JTextField;
import java.awt.Font;
import javax.swing.JTextArea;
import javax.swing.JButton;

import System.MainControl;

public class ChangingExamTimeGui extends JPanel implements ActionListener{

	/**
	 * 
	 */
	private static final long serialVersionUID = 647971598650403711L;
	private JTextField txtTeacherrequestList;
	private JTextField txtReason;
	private JButton btnBack;
	/**
	 * Create the panel.
	 */
	public ChangingExamTimeGui() {
		super();
		setBackground(SystemColor.activeCaption);
		initialize();
	}
	private void initialize() {
		setBorder(new TitledBorder(null, "Changing Exam Time", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		setBackground(SystemColor.activeCaption);
		setBounds(100, 100, 622, 350);
		setLayout(null);
		
		JList list = new JList();
		list.setBounds(39, 68, 152, 179);
		add(list);
		
		JScrollBar scrollBar = new JScrollBar();
		scrollBar.setBounds(23, 68, 17, 178);
		add(scrollBar);
		
		txtTeacherrequestList = new JTextField();
		txtTeacherrequestList.setEditable(false);
		txtTeacherrequestList.setFont(new Font("Microsoft New Tai Lue", Font.BOLD, 13));
		txtTeacherrequestList.setText("TeacherRequest List:");
		txtTeacherrequestList.setBounds(23, 37, 143, 20);
		add(txtTeacherrequestList);
		txtTeacherrequestList.setColumns(10);
		
		JTextArea textArea = new JTextArea();
		textArea.setFont(new Font("Microsoft New Tai Lue", Font.BOLD, 11));
		textArea.setBounds(260, 68, 193, 114);
		add(textArea);
		
		txtReason = new JTextField();
		txtReason.setEditable(false);
		txtReason.setFont(new Font("Microsoft New Tai Lue", Font.BOLD, 13));
		txtReason.setText("Reason :");
		txtReason.setBounds(301, 37, 86, 20);
		add(txtReason);
		txtReason.setColumns(10);
		
		JButton btnApprove = new JButton("Approve");
		btnApprove.setEnabled(false);
		btnApprove.setBounds(265, 212, 89, 23);
		add(btnApprove);
		
		JButton btnDecline = new JButton("Decline");
		btnDecline.setEnabled(false);
		btnDecline.setBounds(364, 212, 89, 23);
		add(btnDecline);
		
		btnBack = new JButton("Back");
		btnBack.setFont(new Font("Microsoft New Tai Lue", Font.BOLD, 13));
		btnBack.addActionListener(this);
		btnBack.setBounds(364, 270, 89, 23);
		add(btnBack);
		
	}
	
	
	@Override			
	public void actionPerformed(ActionEvent e) 
	{
		if(e.getSource()==btnBack)
			MainControl.setGUI(MainControl.currentUser.getRole(), this);
	}
}
